import java.sql.Time;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;

public class Main1 {
  public static void main(String[] args) {
    //
    Callable<String> getResult =
        new Callable<String>() {
          @Override
          public String call() throws Exception {
            TimeUnit.MILLISECONDS.sleep(1000);
            return "我是返回";
          }
        };
      FutureTask futureTask = new FutureTask(getResult);
      futureTask.run();
      try {
          System.out.println(futureTask.get());
      } catch (InterruptedException e) {
          e.printStackTrace();
      } catch (ExecutionException e) {
          e.printStackTrace();
      }
  }
}
